/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package FarmacieDAL;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "RETETA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Reteta.findAll", query = "SELECT r FROM Reteta r"),
    @NamedQuery(name = "Reteta.findByIdReteta", query = "SELECT r FROM Reteta r WHERE r.idReteta = :idReteta"),
    @NamedQuery(name = "Reteta.findByTipCompensat", query = "SELECT r FROM Reteta r WHERE r.tipCompensat = :tipCompensat"),
    @NamedQuery(name = "Reteta.findByUnitateaSanitara", query = "SELECT r FROM Reteta r WHERE r.unitateaSanitara = :unitateaSanitara"),
    @NamedQuery(name = "Reteta.findByAsigurat", query = "SELECT r FROM Reteta r WHERE r.asigurat = :asigurat"),
    @NamedQuery(name = "Reteta.findByDiagnostic", query = "SELECT r FROM Reteta r WHERE r.diagnostic = :diagnostic"),
    @NamedQuery(name = "Reteta.findByDataPrescrierii", query = "SELECT r FROM Reteta r WHERE r.dataPrescrierii = :dataPrescrierii"),
    @NamedQuery(name = "Reteta.findByParafa", query = "SELECT r FROM Reteta r WHERE r.parafa = :parafa"),
    @NamedQuery(name = "Reteta.findByPrescriptie", query = "SELECT r FROM Reteta r WHERE r.prescriptie = :prescriptie")})
public class Reteta implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_RETETA")
    private Integer idReteta;
    @Column(name = "TIP_COMPENSAT")
    private Integer tipCompensat;
    @Column(name = "UNITATEA_SANITARA")
    private String unitateaSanitara;
    @Column(name = "ASIGURAT")
    private String asigurat;
    @Column(name = "DIAGNOSTIC")
    private String diagnostic;
    @Column(name = "DATA_PRESCRIERII")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dataPrescrierii;
    @Column(name = "PARAFA")
    private String parafa;
    @Column(name = "PRESCRIPTIE")
    private String prescriptie;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idReteta")
    private Collection<DetaliiReteta> detaliiRetetaCollection;

    public Reteta() {
    }

    public Reteta(Integer idReteta) {
        this.idReteta = idReteta;
    }

    public Integer getIdReteta() {
        return idReteta;
    }

    public void setIdReteta(Integer idReteta) {
        this.idReteta = idReteta;
    }

    public Integer getTipCompensat() {
        return tipCompensat;
    }

    public void setTipCompensat(Integer tipCompensat) {
        this.tipCompensat = tipCompensat;
    }

    public String getUnitateaSanitara() {
        return unitateaSanitara;
    }

    public void setUnitateaSanitara(String unitateaSanitara) {
        this.unitateaSanitara = unitateaSanitara;
    }

    public String getAsigurat() {
        return asigurat;
    }

    public void setAsigurat(String asigurat) {
        this.asigurat = asigurat;
    }

    public String getDiagnostic() {
        return diagnostic;
    }

    public void setDiagnostic(String diagnostic) {
        this.diagnostic = diagnostic;
    }

    public Date getDataPrescrierii() {
        return dataPrescrierii;
    }

    public void setDataPrescrierii(Date dataPrescrierii) {
        this.dataPrescrierii = dataPrescrierii;
    }

    public String getParafa() {
        return parafa;
    }

    public void setParafa(String parafa) {
        this.parafa = parafa;
    }

    public String getPrescriptie() {
        return prescriptie;
    }

    public void setPrescriptie(String prescriptie) {
        this.prescriptie = prescriptie;
    }

    @XmlTransient
    public Collection<DetaliiReteta> getDetaliiRetetaCollection() {
        return detaliiRetetaCollection;
    }

    public void setDetaliiRetetaCollection(Collection<DetaliiReteta> detaliiRetetaCollection) {
        this.detaliiRetetaCollection = detaliiRetetaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idReteta != null ? idReteta.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Reteta)) {
            return false;
        }
        Reteta other = (Reteta) object;
        if ((this.idReteta == null && other.idReteta != null) || (this.idReteta != null && !this.idReteta.equals(other.idReteta))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "FarmacieDAL.Reteta[ idReteta=" + idReteta + " ]";
    }
    
}
